import { Button } from "antd";
import "./home.css";
import { useNavigate } from "react-router";
import { LOGIN_PATHNAME, MANAGE_INDEX_PATHNAME } from "../../routers";
function Home() {
  const push = useNavigate()
  const userStorage = () => {
    const userInfo = localStorage.getItem('userInfo')
    if (userInfo) {
      push(MANAGE_INDEX_PATHNAME)
    } else {
      push(LOGIN_PATHNAME)
    }


  }
  return (
    <div className="mainLayout flex items-center">
      <div className="flex flex-col justify-between h-40 items-center w-100vw">
        <h1>问卷调查 | 在线投票 </h1>
        <p>已累计创建问卷 1090 份，发布问卷 100 份，收到答卷 10000 份</p>
        <Button type="primary" className="w-30 h-12 text-5" onClick={() => {
          userStorage()
        }}>开始使用</Button>
      </div>
    </div>
  );
}

export default Home;
